1. Field of the Invention
This invention relates to a programmable controller for processing finite state applications programs which control the states of operation of machines and/or processes. The invention also relates to debugging a machine and/or process which allows for easy diagnostics of the finite state applications program.
2. The Prior Art
In the 1960's, programmable controllers were developed to replace relay control systems which used electromagnetic relays to control the operation of industrial machines or processes. These programmable controllers were designed to work as if they contained relay circuits, even though the circuits were actually programs in a computer. The relay circuit designs, emulated by these programmable controllers, were called ladder diagrams because of their general appearance. Ladder diagrams are excellent for designing combination logic control problems, where outputs or actions are directly dependent on the states of inputs or conditions. However, for sequential control problems, where the control actions are time-dependent, the ladder diagram approach becomes cumbersome, difficult to design and fault-find. Lloyd, "Graphical Function Charts Programming for Programmable Controllers," Control Engineering (October 1985).
In order to emulate ladder diagrams, a programmer strings together long lists of Boolean equations in the form of software commands either in text form or graphically. Each command controls an internal or external signal. Debugging or fault-finding in such a system usually involves observing an unexpected condition, and then intuitively searching back through some or all possible combinations of factors that could have caused the unexpected condition. Because all of the ladder diagram is scanned each scan cycle, it is not possible to eliminate any part as definitely not containing the problem.
Another drawback of the ladder diagram controllers is that in order to determine the causes of the unexpected condition it is desirable to record information related to the cause of the problem. However the ladder diagram system does not have any mechanism to differentiate between relevant and irrelevant changes in system variables and conditions, and this leads to the need to store an impractically large amount of data which would be very difficult to analyze and sort.
Furthermore, ladder diagram controllers are cumbersome to program. By their very nature, ladder diagrams are difficult to understand. Additionally ladder diagrams do not clearly show the broader, macro functionality they are designed to provide, particularly sequential functions. What they show is in effect a circuit that provides that functionality. For many years, machine design and manufacturing engineers, who were unfamiliar with ladder diagrams, could not easily develop control systems for their machines or processes. Instead, they relied on specialized control engineers to program their control systems.
In an effort to simplify programmable controllers, systems were developed which enable engineers to use high level languages to emulate "state diagrams." A state diagram is a graphical representation of the states of operation and the conditions which change the status of the states of operation in a machine or process. In graphical form, a state diagram is a series of nodes with interconnecting arcs. Each node represents a particular state of operation and each connecting arc represents a transition function which causes the status of the state to change. State diagrams are easy to understand and easy to design by all types of engineers. The current systems which emulate state diagrams, however, are difficult to program, and difficult to debug.
An example of one such system is disclosed in U.S. Pat. No. 4,562,529 to Drummond. Drummond discusses a method and apparatus for controlling the states of operation of a machine or process by using "state logic variables." A "state logical variable" uniquely represents each operating state of the machine or process. The "state logical variable" can only be one of two values--either TRUE or FALSE, TRUE meaning that the state is active and FALSE meaning that the state is inactive. By using the methods as disclosed, the Drummond system operates very similarly to the ladder diagram controllers. Several problems are present in the Drummond method and apparatus.
First, the entire finite state applications program must be cyclically scanned in order for the Drummond system to properly process the "state logical variables". To make assignments to state variables, which is necessary to make changes of state, or to carry out state dependent actions, Drummond must evaluate many expressions containing state variables. The Drummond patent discusses simplified ways for doing this, however, the process is still inefficient and can be eliminated altogether.
Second, programming the Drummond controller to emulate state diagrams is a cumbersome process. The language disclosed in Drummond does not lend itself to easily converting the state diagrams into program code. This occurs because the condition statements which affect the status of the "state logic variables" cannot be lumped into specific areas of program code and require explicit inclusion of state variable terms on the left hand sides. Additionally, virtually every statement in the code requires a "state logical variable" to be assessed in order to determine whether an state assignment should be made or whether an action should be carried out. As a result, much extra code must be drafted in order to perform simple functions.
Lastly, because every statement in the finite state applications program must be scanned in order to evaluate the status of the state logical variables, the system operates very inefficiently. This drawback severely limits through put and limits the recording of system activity information for debug purposes. Also, Drummond does not disclose an adequate strategy or structure for keeping track of the multiple operating tasks to be controlled simultaneously.
Note should also be taken of the commercially available GRAFCET systems based on French standard NF C 03-190. GRAFCET does not restrict a state diagram to only having one active state at one time and so knowing the identity of one active state in a GRAFCET state diagram does not totally define the conditions and operations associated with that state diagram at that time. This has significant disadvantages during program debugging.
Thus PLC's have been programmed by a means known as ladder diagrams, or an equivalent means, from the early days. As more and more functionality has been added to the language (in the form of available ladder diagram symbols and structure), it has become apparent that there are limitations to the ladder diagram that can only be addressed by a change to the basic approach to programming. This is particularly apparent when PLC's are used for the control of machinery in flexible automation schemes. The functioning of such schemes relies significantly on the ability of the controller to sequence the machinery in a complex and flexible way with regard to both the activities carried out and the functions that step the sequence on and with regard to the ability of the PLC to control many essentially independent sequential processes at the same time. Such things can and are done with ladder diagram PLC's. However such programs require a translation process to generate a ladder diagram from the definition of the sequencing which may be in the form of a written specification or a flow chart. When the ladder diagram is inspected, the functions carried out are not obvious and the program and the process of debugging the program are cumbersome. Much of the information inherent in the spec or flow chart is lost or obscured in the translation process which converts the functional requirements into a relay circuit that fulfills those requirements.
Over the last few years there has been much interest in improving this situation. Sequencing methods have been developed which aim at improving the generation, debugging, and comprehension of such programs. The French GRAFCET effort has been notable and this has been accepted internationally as a useful technique. Related French and West German standards exist. Several PLC's using variations of the GRAFCET methods of describing sequences using standarized flow charts are on the market. However, there are further issues to address to reach an optimum form of control systems programming and these are not addressed by any currently known system.
The problems that need addressing call for improvements in
program structure and form PA0 minimization of transformations PA0 avoidance of side effects PA0 cost of hardware PA0 self-explanatory to widest range of people and user friendly PA0 minimized training PA0 maximum assistance with debugging
focuses on relevant PA1 simplifies understanding of complex systems PA1 suited to high levels of functionality